//
//  FirstViewController.m
//  10-10
//
//  Created by 钟纪旺 on 16/10/10.
//  Copyright © 2016年 zjw. All rights reserved.
//

#import "FirstViewController.h"
#import "QQchatCell.h"

@interface FirstViewController ()

@property (nonatomic, strong) UISearchController *searchCon;
@end

@implementation FirstViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    self.tableView.rowHeight = UITableViewAutomaticDimension;
    self.tableView.estimatedRowHeight = 44;
    
    _searchCon = [[UISearchController alloc] initWithSearchResultsController:[self.storyboard instantiateViewControllerWithIdentifier:@"searchres"]];
    
    self.definesPresentationContext = YES;
    self.tableView.tableHeaderView = _searchCon.searchBar;
    
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"行政主管"]]];
    }

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    
    return 5;
    
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
   
    QQchatCell * cell = [tableView dequeueReusableCellWithIdentifier: @"zhong" forIndexPath:indexPath];
    
    if (indexPath.row ==0) {
        
    
    cell.log.image = [UIImage imageNamed:@"店总.png"];
    cell.nam.text = @"唐超";
    cell.tes.text = @"厉害呢 我的哥";
        cell.tim.text = @"10:30";
    
        return cell;
    }
    else if (indexPath.row ==1)
    {
        cell.log.image = [UIImage imageNamed:@"申请人.png"];
        cell.nam.text = @"廖梦诗";
        cell.tes.text = @"唐超智障";
        cell.tim.text = @"10:31";
        return cell;
    
    
    }
    else if (indexPath.row ==2){
        cell.log.image = [UIImage imageNamed:@"my1"];
        cell.nam.text = @"王成龙";
        cell.tes.text = @"廖梦诗说的对";
        cell.tim.text = @"10:32";
        return cell;
        }
    else if (indexPath.row ==3){
        cell.log.image = [UIImage imageNamed:@"my2"];
        cell.nam.text = @"刘宏广";
        cell.tes.text = @"王成龙说的好";
        cell.tim.text = @"10:33";
        return cell;
    } else if (indexPath.row ==4){
        cell.log.image = [UIImage imageNamed:@"my3"];
        cell.nam.text = @"小鸭子";
        cell.tes.text = @"在？";
        cell.tim.text = @"10:33";
        return cell;
    }
    return cell;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
